<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title>string-jodit-editor</title>

  <!-- json editor -->
  <script src="../../dist/jsoneditor.js"></script>
  <script src="https://unpkg.com/vanilla-picker@2.10.0/dist/vanilla-picker.min.js"></script>
</head>
<body>

<h1>Test</h1>
<label for="debug">Value</label>
<textarea id="debug" class="debug" cols="30" rows="10"></textarea>
<button class='get-value'>Get Value</button>
<div class='container'></div>

<script>
  var container = document.querySelector('.container');
  var debug = document.querySelector('.debug');

  var schema = {
    "type": "object",
    "title": "string-colorpicker-editor",
    "properties": {
      "colorpicker": {
        "type": "string",
        "format": "color",
        "default": "rgba(0,0,0,1)",
        "options": {
          "colorpicker": {
            "alpha": true,
            "editorFormat": "rgb"
          }
        }
      }
    }
  };

  var editor = new JSONEditor(container, {
    schema: schema
  });

  document.querySelector('.get-value').addEventListener('click', function () {
    debug.value = JSON.stringify(editor.getValue());
  });

</script>

</body>
</html>
